<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="common/comon_tag.jsp" %>
<jsp:include page="common/header.jsp"></jsp:include>

	<h2>全部新闻列表</h2>
	<div>
	<form action="${pageContext.request.contextPath }/news_list" method="get">
	 新闻标题:<input type="text" name="ntitle" value="${pageInfo.mapCond.ntitle }"><br>
	 作者:<input type="text" name="nauthor" value="${pageInfo.mapCond.nauthor }"><br>
	 新闻时间:<input type="text" name="ncreateDate" value="${pageInfo.mapCond.ncreateDate }"><br>
	 新闻类型:
	<select name="ntid">
		<option value="0">请选择</option>
		<option value="1">国内</option>
		<option value="2">国际</option>
	</select>
<br>
	 <input type="submit" value="搜索">
	</form>
	</div>
	
	<c:forEach items="${pageInfo.list }" var="temp" varStatus="status">
		<p 
			<c:if test="${status.index % 2 == 0 }">style="background-color: #f5f5f5"</c:if>
		>
			 <a href="news_detail.jsp?nid=${temp.nid }"> ${fn:substring(temp.ntitle,0,15)}
			      <c:if test="${fn:length(temp.ntitle) > 15 }">...</c:if>
			 </a> 
			 -
			 <%-- <fmt:formatDate value="${temp.ncreateDate }" pattern="yyyy-MM-dd HH:mm:ss"/>  --%>
			 <n:formtDate date="${temp.ncreateDate }"></n:formtDate>
		</p>
	</c:forEach>
	<a href="?pageNo=1${ntitle}${pageInfo.linkUrl }"> 首页 </a>
	<c:if test="${pageInfo.hasPrevPage }" >
		<a href="?pageNo=${pageInfo.prevPage }${pageInfo.linkUrl }"> 上一页 </a>
	</c:if>
	<c:forEach items="${pageInfo.groupPage }" var="pageI">
		<a href="?pageNo=${pageI }${pageInfo.linkUrl }">  ${pageI }</a>
	</c:forEach>
	<c:if test="${pageInfo.hasNextPage }">
		<a href="?pageNo=${pageInfo.nextPage }${pageInfo.linkUrl }"> 下一页 </a>
	</c:if>
	<a href="?pageNo=${pageInfo.totalPage }${pageInfo.linkUrl }"> 末页</a>
<jsp:include page="common/footer.jsp"></jsp:include>
<script type="text/javascript">
$(function(){
	
})
</script>
</body>
</html>